export interface TimeProps {
  getNowTime: () => GetNowResultProps;
}

interface GetNowResultProps {
  year: number;
  month: number;
  day: number;
  hour: number;
  minute: number;
  second: number;
  week: number;
}
/**
 * @name getNowTime
 * @alias 获取当前时间
 * @description  获取当前时间信息
 * @return {object} 包含了当前年月日时分秒周几
 */
const getNowTime: TimeProps["getNowTime"] = () => {
  const TempTime = new Date();
  return {
    year: TempTime.getFullYear(),
    month: TempTime.getMonth() + 1,
    day: TempTime.getDate(),
    hour: TempTime.getHours(),
    minute: TempTime.getMinutes(),
    second: TempTime.getSeconds(),
    week: TempTime.getDay(),
  };
};
export const Time: TimeProps = {
  getNowTime,
};
